<template>
  <div class="home">
    <!-- 搜索模块 -->
    <div class="home_search">
      <van-search v-model="serachValue"
                  shape="round"
                  placeholder="请输入搜索关键词"
                  input-align="center" />
    </div>
    <!-- 轮播图 -->
    <div class="hone_swiper">
      <van-swipe :autoplay="3000"
                 indicator-color="red">
        <van-swipe-item v-for="item in banner"
                        :key="item.id">
          <img style="width:100%"
               :src="item.image_url">
        </van-swipe-item>

      </van-swipe>
    </div>

  </div>
</template>

<script>
// @ is an alias to /src

import { GetHome } from "@/api";

export default {
  name: "Home",
  async created () {
    let { data: { data } } = await GetHome();
    console.log(data);
    this.banner = data.banner;

  },
  data () {
    return {
      serachValue: "",
      banner: [],//轮播图的数据
    }
  },
  components: {

  },
};
</script>
